<template>
    <div class="h-6" />
    <el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" background-color="#545c64"
        text-color="#fff" active-text-color="#ffd04b" @select="handleSelect">
        <el-menu-item index="1" @click="cate">首页</el-menu-item>
        <el-menu-item index="1-2">博文</el-menu-item>
        <el-menu-item index="1-3">视频</el-menu-item>
        <el-sub-menu index="2">
            <template #title>下载</template>
            <el-menu-item index="2-1">行业软件</el-menu-item>
            <el-menu-item index="2-2">电子书软件</el-menu-item>
            <el-menu-item index="2-3">PCB参考设计</el-menu-item>
        </el-sub-menu>
        <el-menu-item index="4">行业动态</el-menu-item>
        <el-menu-item index="4-2">干货分享</el-menu-item>
        <el-sub-menu index="4-3">
            <template #title>课程</template>
            <el-menu-item index="4-4">PCB设计一板即成功专栏</el-menu-item>
            <el-menu-item index="4-5">PCB信仰工艺尺配套课程</el-menu-item>
        </el-sub-menu>
        <el-sub-menu index="5">
            <template #title>店铺</template>
            <el-menu-item index="5-1">站内商店</el-menu-item>
            <el-menu-item index="5-2">淘宝店</el-menu-item>
        </el-sub-menu>
        <el-sub-menu index="6">
            <template #title>个人中心</template>
            <el-menu-item index="6-2">我的好友</el-menu-item>
            <!-- <el-menu-item index="6-3">我的账户</el-menu-item> -->
            <el-menu-item index="6-4" @click="sendtext">发表文章</el-menu-item>
            <el-menu-item index="6-5" @click="Changepassword">修改密码</el-menu-item>
            <el-menu-item index="6-6">退出登录</el-menu-item>

        </el-sub-menu>
    </el-menu>
    <router-view></router-view>
</template>

<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router';
import Cate from './cate.vue';
let router = useRouter()
function Changepassword() {
    router.push('/changepassword')
}
const activeIndex = ref('1')
const activeIndex2 = ref('1')
const handleSelect = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
function sendtext() {
    router.push('/tag')
}
function cate() {
    router.push('/myself/cate')
}
onMounted(() => {
    cate()
})
</script>
